var gen = require('./util');

function parseRow() {
    var vals = "('{0}', '{1}', '{2}', '{3}',  now())";
    var sql = ("INSERT INTO reim_project(comp_id, comp_name, project_name,  admin_staff, create_time) VALUES ");
    var data = "广东顺德伯渡服务外包营运管理有限公司\t  南海屈臣氏\t罗杰\t13714652979\n" +
        "安徽数集通劳务服务有限公司\t浙江品勤-顺德人事项目   \t罗杰\t13714652979\n";
    var datas = data.split("\n");
    for (let i = 0; i < datas.length - 1; i++) {
        let row = datas[i].split( new RegExp("\\s+"));
        let comp = row[0];
        let projectName = row[1];
        let formatData = vals.format(gen.getCompId( comp), comp, projectName, row[2], row[3]);
        sql += formatData + ",\n";
    }
    console.log(sql.substring(0, sql.lastIndexOf(",")));
}

parseRow()